import 'package:backend.core/core/domain/entities/api/web/api_web_purchased_subscription_transaction.dart';
import 'package:backend.core/core/domain/entities/api/web/yookassa/api_yookassa_purchased_subscription_transaction.dart';
import 'package:backend.purchases/infrastructure/dtos/api/web/api_web_purchased_subscription_transaction_dto.dart';
import 'package:backend.purchases/infrastructure/dtos/api/web/yookassa/api_yookassa_purchased_subscription_transaction_dto.dart';

class ApiWebPurchasedSubscriptionTransactionDtoFactory {
  const ApiWebPurchasedSubscriptionTransactionDtoFactory._internal();

  static const _instance = ApiWebPurchasedSubscriptionTransactionDtoFactory._internal();

  factory ApiWebPurchasedSubscriptionTransactionDtoFactory() {
    return _instance;
  }

  ApiWebPurchasedSubscriptionTransactionDto fromEntity(
      ApiWebPurchasedSubscriptionTransaction transaction) {
    if (transaction is ApiYookassaPurchasedSubscriptionTransaction) {
      return ApiYookassaPurchasedSubscriptionTransactionDto.fromEntity(transaction);
    }

    throw UnimplementedError();
  }
}
